<?php

namespace SL\FrontBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class InfosController extends Controller
{
	public function getAgenceAction()
	{
		$repository = $this->getDoctrine()->getManager()->getRepository('SLFrontBundle:Agence');
		
		$page = $repository->findOneBy(array('id' => 1));
		if ($page === null)
		{
			throw $this->createNotFoundException('Erreur dans la base de données, la page Agence est introuvable.');
		}
		
		return $this->render('SLFrontBundle:Infos:agence.html.twig', array('template' => "agency", 'menu' => "agency", 'js' => "default", 'page' => $page));
	}

	public function getContactAction()
    {
		$repository = $this->getDoctrine()->getManager()->getRepository('SLFrontBundle:Contact');
		
		$page = $repository->findOneBy(array('id' => 1));
		if ($page === null)
		{
			throw $this->createNotFoundException('Erreur dans la base de données, la page Contact est introuvable.');
		}
		
        return $this->render('SLFrontBundle:Infos:contact.html.twig', array('template' => "contact", 'menu' => "contact", 'js' => "default", 'page' => $page));
    }
}
